import request from "@/utils/request";

//获取某个角色信息
export function getRoleInfo(id) {
  //   console.log(id);
  return request({
    url: "/role/" + id,
    method: "get"
  });
}
//获取角色列表
export function getRoleList(data) {
  return request({
    url: "/role",
    method: "get",
    params: data
  });
}
//添加
export function addRoleInfo(data) {
  console.log(data);
  return request({
    url: "/role",
    method: "post",
    data: data
  });
}
//删除
export function delRoleInfo(id) {
  console.log(id);
  return request({
    url: "/role/" + id,
    method: "delete"
  });
}
//修改
export function editRoleInfo(data) {
  console.log(data);
  return request({
    url: "/role/" + data.id,
    method: "put",
    data: data.data
  });
}

//获取菜单列表
export function getMenuList() {
  return request({
    url: "/getMenu/",
    method: "get",
    
  });
}

//设置角色与菜单的关系
export function editRoleMenu(data) {
  console.log(data);
  return request({
    url: "/setMenu/",
    method: "post",
    data: data
  });
}

//设置角色与用户的关系
export function editRoleUser(data) {
  console.log(data);
  return request({
    url: "/setUser/",
    method: "post",
    data: data
  });
}

